package com.samsung.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class ContentsDB {

	public static final int VERSION = 1;
	public static final String DB_NAME = "tracking_db.sqlite";
	public static final String LATITUTE = "latitude";
	public static final String LONGITUDE = "longitude";
	public static final String ISSEND = "issend";
	public static final String OTHERNUMBER = "othernumber";
	public static final String SETDATE = "setdate";
	
	private static MemberSQLiteOpenHelper mDbHelper;
	private static SQLiteDatabase mDb;
	static Context mCtx;
	
	
	public ContentsDB(Context ctx) {
		this.mCtx = ctx;
		mDbHelper = new MemberSQLiteOpenHelper(mCtx);
		mDb = mDbHelper.getWritableDatabase();
	}
	
	public static class MemberSQLiteOpenHelper extends SQLiteOpenHelper {

		public MemberSQLiteOpenHelper(Context context) {
			super(context, DB_NAME, null, VERSION);
			// TODO Auto-generated constructor stub
		}

		@Override
		public void onCreate(SQLiteDatabase db) {
			// TODO Auto-generated method stub
			MessageDB.createTable(db);
			CallDB.createTable(db);
			PictureDB.createTable(db);
			GpsDB.createTable(db);
		}

		@Override
		public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
			// TODO Auto-generated method stub

		}
	}

	
	public void close() {
		mDbHelper.close();
	}

	
}
